package com.imist.PipelineAndChannelHandler.utils;

import com.imist.PipelineAndChannelHandler.attribute.Attributes;
import io.netty.channel.Channel;

public class LoginUtils {

    /**
     * 标记为登陆成功
     * @param channel
     */
    public static void markAsLogin(Channel channel){
        channel.attr(Attributes.LOGIN).set(true);
    }

    /**
     * 判断是否登陆成功
     * @param channel
     * @return
     */
    public static boolean hasLogin(Channel channel){
        return channel.attr(Attributes.LOGIN).get() != null;
    }
}
